/**
 * @开发版权 
 * @项目名称 VFCloud-PaaS
 * @版本信息 v1.0
 * @开发人员 zhous
 * @开发日期 2023-02-21
 * @修订日期
 * @描述  ApplicationClosedEventListener
 */
package com.microframework.base.web.listener;

import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextClosedEvent;
import org.springframework.stereotype.Component;

import com.microframework.base.core.dbconfig.DbConfigUtil;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@Component
public class ApplicationClosedEventListener implements ApplicationListener<ContextClosedEvent> {

	@Override
	public void onApplicationEvent(ContextClosedEvent event) {
		try {
			DbConfigUtil.stopAll();
		}catch (Exception e) {
			log.error("停止数据源异常:{}.",e.getMessage());
		}
		
	}

}
